﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace TextEditorI.Algorithm
{
    /// <summary>
    /// 存放各种工具函数
    /// </summary>
    class Util
    {
        /// <summary>
        /// 传入一个文本，将其分割成字符串数组
        /// </summary>
        /// <param name="text"></param>
        /// <returns></returns>
        static public string[] GetWordArray(string text)
        {
            string pattern = @"[^a-zA-Z]";
            string[] words = Regex.Split(text, pattern);
            return words;
        }
    }
}
